<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例15-焦点</title>
    <script src="jquery.js"></script>
    <script>
        $(function (){
            $("#username").focus(function (){
                console.log("username获得焦点")
            }).blur(function (){
                // $("#username").val()
                console.log("username失去焦点")
                console.log(this.value)
            })
        })

    </script>
</head>
<body>
    <div>
        <h1>用户登录</h1>
        <p>
            用户名:<input id="username"/>
        </p>
        <p>
            密码:<input id="password"/>
        </p>
        <p>
            <button>登录</button>
        </p>
    </div>
</body>
</html>